<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org">

<head>
    <title>快租</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <!--引入bootstrap-->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
    <link rel="stylesheet" href="../../css/index.css">
</head>

<body>



    <div id="main">
        <!--选择登录方式-->
        <div th:id="cs">
            <div class="jumbotron">
                <h1 class="display-4">快租</h1>
                <p class="lead">“睡在山海间，住在人情里。”</p>
                <hr class="my-4">
                <p>请选择您的登录方式</p>
                <button type="button" class="btn btn-primary btn-lg" id="useUser">用户登录</button>
                &nbsp;&nbsp;&nbsp;
                <button type="button" class="btn btn-primary btn-lg" id="useAdmin">管理员登录</button>
            </div>
            <div  th:text="${msg}" id="msg" style="color: red">
            </div>
        </div>


        <!--管理员登录-->
        <form th:action="@{/admin/adminLogin}" id="adminLoin" style="display: none" th:method="POST">
            <div>亲爱的管理员,欢迎登陆</div>
            <div class="form-group">
                <label for="userAccountNumber">账号</label>
                <input type="text" class="form-control" id="userAccountNumber" name="adminName" >
            </div>
            <div class="form-group">
                <label for="userPassword">密码</label>
                <input type="password" class="form-control" id="userPassword" name="password">
            </div>
            <div class="form-group form-check">
                <a th:href="@{/register/toAdminRegister}" style="float: right">没有账号？注册一个</a>
            </div>
            <button type="submit" class="btn btn-primary">登陆</button>
            <button type="button" class="btn btn-primary" th:onclick="retu()">返回上一步</button>
        </form>


        <!--用户登录-->
        <form th:action="@{/userCon/userLogin}" id="userLogin" style="display: none" th:method="POST">
            <div>亲爱的用户，欢迎登录</div>
            <div class="form-group">
                <label for="accountNumber">账号</label>
                <input type="text" class="form-control" id="accountNumber" th:name="userName" >
            </div>
            <div class="form-group">
                <label for="exampleInputPassword1">密码</label>
                <input type="password" class="form-control" id="exampleInputPassword1" name="password">
            </div>
            <div class="form-group form-check">
                <a th:href="@{/register/toUserRegister}" style="float: right">没有账号？注册一个</a>
            </div>
            <button type="submit" class="btn btn-primary">登陆</button>
            <button type="button" class="btn btn-primary" th:onclick="retu()">返回上一步</button>
        </form>
    </div>




<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js" integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+" crossorigin="anonymous"></script>
</body>

<script>
    $('#useUser').click(function () {
        $('#cs').hide();
        $('#adminLoin').hide();
        $('#userLogin').show();
    });
    $('#useAdmin').click(function () {
        $('#cs').hide();
        $('#adminLoin').show();
        $('#userLogin').hide();
    });
    function retu() {
        $('#cs').show();
        $('#adminLoin').hide();
        $('#userLogin').hide();
    }
    setTimeout(function () {
        $('#msg').remove();
    },3000)
</script>
</html>